home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2000 September / september_2000.iso / intercd / root / ^Linux / WindowMaker / src / framewin.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-11  |  5.4 KB  |  196 lines

  1. /*
  2.  *  Window Maker window manager
  3.  * 
  4.  *  Copyright (c) 1997, 1998 Alfredo K. Kojima
  5.  * 
  6.  *  This program is free software; you can redistribute it and/or modify
  7.  *  it under the terms of the GNU General Public License as published by
  8.  *  the Free Software Foundation; either version 2 of the License, or
  9.  *  (at your option) any later version.
  10.  *
  11.  *  This program is distributed in the hope that it will be useful,
  12.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  *  GNU General Public License for more details.
  15.  *
  16.  *  You should have received a copy of the GNU General Public License
  17.  *  along with this program; if not, write to the Free Software
  18.  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 
  19.  *  USA.
  20.  */
  21.  
  22. #ifndef WMFRAMEWINDOW_H_
  23. #define WMFRAMEWINDOW_H_
  24.  
  25.  
  26. #define BORDER_TOP    1
  27. #define BORDER_BOTTOM    2
  28. #define BORDER_LEFT    4
  29. #define BORDER_RIGHT    8
  30. #define BORDER_ALL    (1|2|4|8)
  31.  
  32.  
  33. #define WFF_TITLEBAR    (1<<0)
  34. #define WFF_LEFT_BUTTON    (1<<1)
  35. #define WFF_RIGHT_BUTTON (1<<2)
  36. #define WFF_RESIZEBAR    (1<<3)
  37. #define WFF_BORDER    (1<<4)
  38. #define WFF_SINGLE_STATE (1<<5)
  39. #ifdef XKB_BUTTON_HINT
  40. #define WFF_LANGUAGE_BUTTON    (1<<6)
  41. #endif
  42.  
  43.  
  44. #define WFF_IS_SHADED    (1<<16)
  45.  
  46. typedef struct WFrameWindow {
  47.     WScreen *screen_ptr;           /* pointer to the screen structure */
  48.     
  49.     WCoreWindow *core;
  50.     
  51.     WCoreWindow *titlebar;           /* the titlebar */
  52.     WCoreWindow *left_button;           /* miniaturize button */
  53. #ifdef XKB_BUTTON_HINT
  54.     WCoreWindow *language_button;
  55. #endif
  56.     WCoreWindow *right_button;           /* close button */
  57.  
  58.     short workspace;               /* workspace that the window occupies */
  59.  
  60.     short top_width;
  61.     int *title_clearance;
  62.     short bottom_width;
  63.  
  64.     short resizebar_corner_width;
  65.  
  66.     WCoreWindow *resizebar;           /* bottom resizebar */
  67.  
  68.     Pixmap title_back[3];           /* focused, unfocused, pfocused */
  69.     Pixmap resizebar_back[3];           /* any, None, None */
  70.     Pixmap lbutton_back[3];
  71.     Pixmap rbutton_back[3];
  72. #ifdef XKB_BUTTON_HINT
  73.     Pixmap languagebutton_back[3];
  74. #endif
  75.  
  76.     WPixmap *lbutton_image;
  77.     WPixmap *rbutton_image;
  78. #ifdef XKB_BUTTON_HINT
  79.     WPixmap *languagebutton_image;
  80. #endif
  81.     
  82.     union WTexture **title_texture;
  83.     union WTexture **resizebar_texture;
  84.     unsigned long *title_pixel;
  85. #ifdef DRAWSTRING_PLUGIN
  86.     int drawstring_proc_offset;
  87. #endif
  88.     GC *title_gc;
  89.     WMFont **font;
  90.  
  91.     char *title;               /* window name (title) */
  92.  
  93. #ifdef KEEP_XKB_LOCK_STATUS
  94.     int languagemode;
  95.     int last_languagemode;
  96. #endif /* KEEP_XKB_LOCK_STATUS */
  97.  
  98.     /* thing that uses this frame. passed as data to callbacks */
  99.     void *child;
  100.     
  101.     /* callbacks */
  102.     void (*on_click_left)(WCoreWindow *sender, void *data, XEvent *event);
  103. #ifdef XKB_BUTTON_HINT
  104.     void (*on_click_language)(WCoreWindow *sender, void *data, XEvent *event);
  105. #endif
  106.     
  107.     void (*on_click_right)(WCoreWindow *sender, void *data, XEvent *event);
  108.     void (*on_dblclick_right)(WCoreWindow *sender, void *data, XEvent *event);
  109.     
  110.     void (*on_mousedown_titlebar)(WCoreWindow *sender, void *data, XEvent *event);
  111.     void (*on_dblclick_titlebar)(WCoreWindow *sender, void *data, XEvent *event);
  112.  
  113.     void (*on_mousedown_resizebar)(WCoreWindow *sender, void *data, XEvent *event);
  114.     
  115.     struct {
  116.     unsigned int state:2;           /* 3 possible states */
  117.     unsigned int justification:2;
  118.     unsigned int titlebar:1;
  119.     unsigned int resizebar:1;
  120.     unsigned int left_button:1;
  121.     unsigned int right_button:1;
  122. #ifdef XKB_BUTTON_HINT
  123.     unsigned int language_button:1;
  124. #endif
  125.  
  126.     unsigned int need_texture_remake:1;
  127.  
  128.     unsigned int single_texture:1;
  129.     
  130.     unsigned int hide_left_button:1;
  131.     unsigned int hide_right_button:1;
  132. #ifdef XKB_BUTTON_HINT
  133.     unsigned int hide_language_button:1;
  134. #endif
  135.     
  136.     unsigned int need_texture_change:1;
  137.     
  138.     unsigned int lbutton_dont_fit:1;
  139.     unsigned int rbutton_dont_fit:1;
  140. #ifdef XKB_BUTTON_HINT
  141.     unsigned int languagebutton_dont_fit:1;
  142. #endif
  143.  
  144.     unsigned int repaint_only_titlebar:1;
  145.     unsigned int repaint_only_resizebar:1;
  146.  
  147.     unsigned int is_client_window_frame:1;
  148.     
  149.     unsigned int incomplete_title:1;
  150.  
  151. #ifdef OLWM_HINTS
  152.     unsigned int right_button_pushed_in:1;
  153. #endif
  154.     } flags;
  155. } WFrameWindow;
  156.  
  157.  
  158. WFrameWindow*
  159. wFrameWindowCreate(WScreen *scr, int wlevel, int x, int y, 
  160.            int width, int height, int *clearance, int flags,
  161.            union WTexture **title_texture, 
  162.            union WTexture **resize_texture,
  163.            unsigned long *color, 
  164. #ifdef DRAWSTRING_PLUGIN
  165.            int function_offset,
  166. #endif
  167.            GC *gc, WMFont **font);
  168.  
  169. void wFrameWindowUpdateBorders(WFrameWindow *fwin, int flags);
  170.  
  171. void wFrameWindowDestroy(WFrameWindow *fwin);
  172.  
  173. void wFrameWindowChangeState(WFrameWindow *fwin, int state);
  174.  
  175. void wFrameWindowPaint(WFrameWindow *fwin);
  176.  
  177. void wFrameWindowConfigure(WFrameWindow *fwin, int x, int y, int width, int height);
  178.  
  179. void wFrameWindowResize(WFrameWindow *fwin, int width, int height);
  180.  
  181. void wFrameWindowShowButton(WFrameWindow *fwin, int flags);
  182.  
  183. void wFrameWindowHideButton(WFrameWindow *fwin, int flags);
  184.  
  185. int wFrameWindowChangeTitle(WFrameWindow *fwin, char *new_title);
  186.  
  187. #ifdef OLWM_HINTS
  188. void wFrameWindowUpdatePushButton(WFrameWindow *fwin, Bool pushed);
  189. #endif
  190.  
  191. #ifdef XKB_BUTTON_HINT
  192. void wFrameWindowUpdateLanguageButton(WFrameWindow *fwin);
  193. #endif
  194.  
  195. #endif
  196.